//
//  HLJCommunityViewController.m
//  B段项目
//
//  Created by 111111 on 15/12/25.
//  Copyright © 2015年 张智超. All rights reserved.
//

#import "HLJCommunityViewController.h"
#import "HLJTalkViewController.h"
@interface HLJCommunityViewController ()<UIScrollViewDelegate>

@property (nonatomic, retain)UIScrollView *communityScrollV;
@end

@implementation HLJCommunityViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    
    self.titleLabel.text = @"社区";
    
    //图标
    UIImageView *img = [[UIImageView alloc]initWithFrame:CGRectMake(WIDTH - WIDTH/4.5, WIDTH/40, WIDTH/16, WIDTH/16)];
    img.image = [UIImage imageNamed:@"iconfont-renyuanxiaozu.png"];
    img.center = CGPointMake(WIDTH - WIDTH/5, self.navigationController.navigationBar.frame.size.height /2);
    [self.rightView addSubview:img];
       
    
    
    
#pragma mark- 首页scrollView
    self.communityScrollV = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, WIDTH, HEIGHT)];
    [self.view addSubview:self.communityScrollV];
    self.communityScrollV.delegate = self;

    self.communityScrollV.contentSize = CGSizeMake(WIDTH, 0);
    self.communityScrollV.showsHorizontalScrollIndicator = YES;
    // 设置按页滑动
    self.communityScrollV.pagingEnabled = YES;
    // 取消边界反弹效果
    self.communityScrollV.bounces = NO;
    self.communityScrollV.contentOffset = CGPointMake(0, 0);
    
    // 首页碎片
    HLJTalkViewController *talkVC = [[HLJTalkViewController alloc] init];
    talkVC.view.frame = CGRectMake(0, 0, WIDTH, HEIGHT);
    [self.communityScrollV addSubview:talkVC.view];
    [self addChildViewController:talkVC];

    
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
